;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@PKBattle]
{
#IF
equal z12 1
#SAY
Processing System...\
Please wait...\
#ACT
Delaygoto [Grobal] 3 @lingqujppk
#ELSESAY
The battle has not been started?!?!\
<[ Return to Town ]/@hubiq>

[@lingqujppk]
#IF
hour 21 23
min  10 59
#ACT
goto @btimeok
#ELSESAY
You can only recieve the prize between 21:10 and 24:00\\
<[ Exit ]/@exit>

[@btimeok]
#IF
checkhum PK2 2
#SAY
There are still 2+ people left, come back later!\\
<[ Exit ]/@exit>
#ELSEACT
goto @lingqupkpkok

[@lingqupkpkok]
#IF
hour 21 23
min  10 59
!checkhum PK2 2
#SAY
Congratulations!! You will get a nice reward!!\
<[ Collect Prize ]/@pkjiang52>\\
<[ Exit ]/@exit>

[@pkjiang52]
#IF
!checkhum PK2 2
equal z12 1
#ACT
   mov A1 %username
   mov z12 0
   loadvalue N2 "QuestDiary\IntegralSystem\PKBattle\PKBattleInfo.txt" Info Total
   lineMsg [Grobal] "[ Attention ] <$OUTPUT(A1)> has won the PK Battle and takes a prize of <$OUTPUT(N2)> Million!!"
   SAVEVALUE "QuestDiary\IntegralSystem\PKBattle\PKBattleInfo.txt" Info Total 0
   Give  GoldBar  %N5
#SAY
You have won <$OUTPUT(N5)> Gold!\\
<[ Move to Town ]/@hubiq>\

[@hubiq]
#ACT
mapmove 1 400 120
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;